<h2>Cat&eacute;gories</h2>

<div id="ajax-response">
<?php 
if(isset($_SESSION['notification'])){
	echo implode(' <br/> ',$_SESSION['notification']);
	unset($_SESSION['notification']);
}
?>
</div>

<form class="search-form" method="post" accept-charset="utf-8" action="">
<p class="search-box">
  <input name="search_categories" value="" id="tag-search-input" type="text">
	<input value="Rechercher Categories" type="submit">
</p>
</form>
<br class="clear">

<div id="col-container">

<div id="col-right">
<div class="col-wrap">
<form id="posts-filter" method="post" accept-charset="utf-8" action="">
	<div class="tablenav top">
		<div class="alignleft actions">
		<select name="action">
			<option>Action globale</option>
			<option value="delete">Supprimer</option>
		</select>
		<input type="submit" value="Appliquer" name="doaction" />
		</div>

		<br class="clear">
	</div>
<table  class="wp-list-table widefat fixed tags">
	<thead>
	<tr>
	<?php
		if(isset($tableCategoryHeader))
		foreach ($tableCategoryHeader as $nameTable=>$tableHeader){
			if($nameTable) echo '<th class="manage-column column-'.$nameTable.' sortable desc" id="'.$nameTable.'" scope="col">
							<a href="#'.$nameTable.'"><span>'.$tableHeader.'</span><span class="sorting-indicator"></span></a></th>
		
						';
			else echo '<th class="manage-column column-'.$nameTable.' check-column" id="'.$nameTable.'" scope="col">
						<label for="cb-select-all-1" class="screen-reader-text">Select All</label><input type="checkbox" id="cb-select-all-1">
					</th>
						';
		}
		
	?>
	</tr>
	</thead>

	<tfoot>
		<tr><?php 
			if(isset($tableCategoryHeader))
			foreach ($tableCategoryHeader as $nameTable=>$tableHeader){
				if($nameTable) echo '<th class="manage-column column-'.$nameTable.' sortable desc" id="'.$nameTable.'" scope="col">
								<a href="#'.$nameTable.'"><span>'.$tableHeader.'</span><span class="sorting-indicator"></span></a></th>
			
							';
				else echo '<th class="manage-column column-'.$nameTable.' check-column" id="'.$nameTable.'" scope="col">
							<label for="cb-select-all-1" class="screen-reader-text">Select All</label><input type="checkbox" id="cb-select-all-1">
						</th>
							';
			}
		?>
		</tr>
	</tfoot>

	<tbody data-wp-lists="list:tag" id="the-list">
	<?php 
	foreach($tableCategoryBody as $row){
	
		$id=$row['id'];
			echo "
		<tr class='alternate' id='tag-$id'>
			<th class='check-column' scope='row'><label for='cb-select-$id' class='screen-reader-text'>{$row['name']}</label><input type='checkbox' id='cb-select-$id' value='$id' name='delete_tags[]'></th>
			<td class='name column-name'><strong><a title='Edit �{$row['name']}�' href='admin/edit/$id' class='row-title'>{$row['name']}</a></strong><br><div class='row-actions'>
				<span class='edit'><a href='admin/edit/$id'>Edition</a> | </span>
				<span class='inline editinline'> Edition rapide | </span>
				<span class='delete'><a href='admin/delete/$id' class='delete-tag'>Supprimer</a> | </span>
				<span class='view'><a href='{$CFG->config['base_url']}{$row['link']}/'>Voir</a></span></div>
				<div id='inline_$id' class='hidden'>
					<div class='name'>{$row['short-name']}</div>
					<div class='slug'>{$row['slug']}</div>
					<div class='parent'>{$row['parent']}</div>
				</div>
			</td>
			<td class='slug column-slug'>{$row['slug']}</td>
			<td class='description column-description'>{$row['option']}</td>
			<td class='posts column-posts'>{$row['count']}</td>
		</tr>";
		}
	?>
	</tbody>
</table>
	<div class="tablenav bottom">
		<div class="alignleft actions">
		<select name="action">
			<option>Action globale</option>
			<option value="delete">Supprimer</option>
		</select>
		<input type="submit" value="Appliquer" name="doaction" />
		</div>
		<br class="clear">
	</div>

<br class="clear">
</form>

<div class="form-wrap">
<p><strong>Note:</strong><br>
  Supprimer une cat&eacute;gorie ne supprime pas les m&eacute;ssages pr&eacute;sent dans celle ci.
Cependant les messages qui ont &eacute;t&eacute; affect&eacute;s sont mis dans la cat&eacute;gorie <strong>Non class&eacute;</strong>.</p>
<p>Les cat&eacute;gories selectionn&eacute;es peuvent etre converti en utilisant des balises pour <a href="import.php">marquer la cat&eacute;gorie</a>.</p>
</div>

</div>
</div><!-- /col-right -->

<div id="col-left">
<div class="col-wrap">


<div class="form-wrap">
<input type="submit" value="Ajouter Nouvelle Categorie" class="button button-primary" id="submit" name="add_category"/>
<form class="validate" action="" method="post" id="addtag">
<div class="form-field form-required">
	<label for="tag-name">Nom de la catégorie:</label>
	<input type="text" aria-required="true" size="40" value="" id="tag-name" name="name"/>
</div>
<div class="form-field">
	<label for="tag-slug">URL simplifié:</label>
	<input type="text" size="40" value="" id="tag-slug" name="slug"/>
	<p>L'URL simplifié est généré automatiquement. Il dois etre en minuscules, uniquement des lettres/chiffres et  traits d'union pour les espace.</p>
</div>
<div class="form-field">
	<label for="parent">Parent :</label>
	<select class="postform" id="parent" name="parent">
		<option value="0">Aucun</option>
		<?php echo $option_category?>
	</select>
			<p>Les Catégories peuvent avoir une hiérachie. Exemple catégorie principale &quot;Voiture&quot; et sous catégorie &quot;Electrique&quot; et &quot;Essence&quot;</p>
	</div>
<div class="form-field">
	<label for="showPrice" class="checkbox">Afficher le prix ?
		<input id="showPrice" name="showPrice" value="1" type="checkbox" checked="checked"/>
	</label>
	</div>
<div class="form-field">
	<label for="tag-option"> <a href="<?php echo $CFG->config['base_url']?>setting/option">Option :</a></label>
	<table>
	<?php
	if(!empty($CategoryListOption))
		foreach($CategoryListOption as $list){
	?>
		<tr>
			<td>
            <input type="checkbox" value="<?php echo $list->id_type?>" 
            name="option[]" />  </td>
			<td><a href="<?php echo "{$CFG->config['base_url']}setting/option#option-{$list->id_type}"?>"><?php echo $list->name?></a></td>
		</tr>
	<?php }?>
	</table>
</div>
<div class="form-field">
	<label for="tag-description">Description :</label>
	<textarea cols="40" rows="5" id="tag-description" name="description"></textarea>
	<p>La description n'est pas visible, par d&eacute;faut, cependant certains th&egrave;mes peuvent &ecirc;tre vue.</p>
</div>

<p class="submit"><input type="submit" value="Ajouter Nouvelle Categorie" class="button button-primary" id="submit" name="add_category"></p></form></div>

</div>
</div><!-- /col-left -->

</div><!-- /col-container -->
</div><!-- /wrap -->
<script type="text/javascript">
try{document.forms.addtag['tag-name'].focus();}catch(e){}
</script>

	<table style="display: none">
	<tbody id="inlineedit">
		<tr style="display: none" class="inline-edit-row" id="inline-edit">
		<td class="colspanchange" colspan="5">

		<form action="" method="post">
			<fieldset>
			<div class="inline-edit-col">
				<h4>Edition Rapide</h4>

				<label>
					<span class="title">Nom</span>
					<span class="input-text-wrap"><input id="tag-name" type="text" value="" class="ptitle" name="name" onchange="$(this).parents('form').find('#tag-slug').val(convert_accent(this.value));checkUrl(url_friendly)"></span>
				</label>
				<p class="clear"/>
				<label>
					<span class="title">Slug</span>
					<span class="input-text-wrap"><input id="tag-slug" type="text" value="" class="ptitle" name="slug"></span>
				</label>
			</div>
			</fieldset>
	
		<p class="inline-edit-save submit">
			<button class="cancel button-secondary alignleft" title="Cancel" accesskey="c">Cancel</button>
			<button class="save button-primary alignright" name="Update_Category"  value="Update_Category" type="submit" accesskey="s">Update Category</button>
			<span class="spinner"></span>
			<input type="hidden" value="" name="id">
			<input type="hidden" value="" name="parent">
			<br class="clear"/>
		</p>
		</form>
		</td>
		</tr>
		</tbody></table>
	

<div class="clear"></div>